package com.breakfast.fun.data.entity.home.product;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yukai on 16/9/29.
 */

public class ProductComment {

    /**
     * total : 6
     * pageTotal : 6
     * data : [{"id":2618,"accountMobile":"18650075050","content":"好","ave":5,"commentType":"好评","addTime":"2016-09-20 19:16:41","isReply":1,"reply":{"id":692,"commentId":2618,"content":"谢谢您对早范的支持，您可以通过添加客服微信号（客服微信号：zaofanzaocan）有什么需要都可以告诉我们的客服。早范，不仅关心您的早餐，更关心您的健康^O^ \n","addTime":"2016-09-21 11:22:40"},"nickName":"18650075050","userPhoto":""},{"id":2720,"accountMobile":"18650061326","content":"好好好好好","ave":5,"commentType":"好评","addTime":"2016-09-24 16:27:26","isReply":0,"nickName":"186****1326","userPhoto":""},{"id":2761,"accountMobile":"18359928629","content":"wow","ave":5,"commentType":"好评","addTime":"2016-09-26 15:57:00","isReply":0,"nickName":"zzhyzy","userPhoto":"http://m.52letsgo.cn/user_photo/7/2/2aedcaa9-d_-772532567.jpg"},{"id":2817,"accountMobile":"15880056292","content":"没有及时","ave":4,"commentType":"好评","addTime":"2016-09-26 23:14:22","isReply":0,"nickName":"15880056292","userPhoto":"http://m.52letsgo.cn/user_photo/12/13/ac853e0b-a_25377590.jpg"},{"id":2833,"accountMobile":"18305917261","content":"口感不错，除了豆浆，希望可以换别的，比如说红豆，红枣，五谷杂粮研磨的，胃不好的同志不易喝豆浆谢谢","ave":5,"commentType":"好评","addTime":"2016-09-27 22:30:44","isReply":0,"nickName":"18305917261","userPhoto":"http://m.52letsgo.cn/user_photo/0/11/1861a064-e_-1953699993.jpg"},{"id":2834,"accountMobile":"18659167722","content":"台风请通知小哥不要送","ave":5,"commentType":"好评","addTime":"2016-09-28 07:25:35","isReply":0,"nickName":"186****7722","userPhoto":""}]
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    private String msg;
    private boolean success;
    /**
     * id : 2618
     * accountMobile : 18650075050
     * content : 好
     * ave : 5.0
     * commentType : 好评
     * addTime : 2016-09-20 19:16:41
     * isReply : 1
     * reply : {"id":692,"commentId":2618,"content":"谢谢您对早范的支持，您可以通过添加客服微信号（客服微信号：zaofanzaocan）有什么需要都可以告诉我们的客服。早范，不仅关心您的早餐，更关心您的健康^O^ \n","addTime":"2016-09-21 11:22:40"}
     * nickName : 18650075050
     * userPhoto :
     */

    private List<ProductCommentData> data;

    public static ProductComment objectFromData(String str) {

        return new Gson().fromJson(str, ProductComment.class);
    }

    public static List<ProductComment> arrayProductCommentFromData(String str) {

        Type listType = new TypeToken<ArrayList<ProductComment>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public List<ProductCommentData> getData() {
        return data;
    }

    public void setData(List<ProductCommentData> data) {
        this.data = data;
    }

}
